package com.fieldchain.ex.fa100.ui.personal.adapter;

import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.fieldchain.ex.fa100.R;
import com.fieldchain.ex.fa100.bean.BankChoseBean;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by biyunlong
 * Email: 1225198434@qq.com
 * Data:  2018/9/13
 */
public class BonusAdapter extends RecyclerView.Adapter<BonusAdapter.ViewHolder> {
    private Context mContext;

    public BonusAdapter(Context mContext) {
        this.mContext = mContext;
    }

    private List<BankChoseBean> list = new ArrayList<>();

    public void setData(List<BankChoseBean> list) {
        this.list.clear();
        this.list.addAll(list);
        notifyDataSetChanged();
    }

    @Override
    public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(mContext).inflate(R.layout.item_bonus, parent, false);
        return new ViewHolder(view);
    }

    @Override
    public void onBindViewHolder(ViewHolder holder, int position) {
//          holder.reaBonus.setOnClickListener(new View.OnClickListener() {
//              @Override
//              public void onClick(View view) {
//
//              }
//          });
    }

    @Override
    public int getItemCount() {
        return list.size() + 2;
    }

    public class ViewHolder extends RecyclerView.ViewHolder {
        private RelativeLayout reaBonus;
        private TextView tvNum;
        private TextView tvTime;


        public ViewHolder(View itemView) {
            super(itemView);
            reaBonus = itemView.findViewById(R.id.rea_bonus);
            tvNum = itemView.findViewById(R.id.tv_num);
            tvTime = itemView.findViewById(R.id.tv_time);
        }
    }
}
